﻿@using Newtonsoft.Json;
@{
    var user = Session["User"];    
}
<script src="~/Scripts/kendo/jquery.min.js"></script>
<script src="~/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
<div class="sidebar-nav nav-collapse collapse navbar-collapse">
    <ul class="nav main-menu">
        <li><a href="#"><i class="icon-bar-chart"></i><span class="hidden-sm text">Dashboard</span></a></li>
        <li>
            <a class="dropmenu" href="#"><i class="icon-list-alt"></i><span class="hidden-sm text">Realizar Servicios</span> <span class="chevron closed"></span></a>
            <ul>
                <li><a class="submenu" href="@Url.Action("Create", "Servicio")"><i class="icon-edit"></i><span class="hidden-sm text">Registrar Servicio</span></a></li>
                @*<li><a class="submenu" href="#"><i class="icon-edit"></i><span class="hidden-sm text">SubItem 1</span></a></li>
                <li><a class="submenu" href="#"><i class="icon-edit"></i><span class="hidden-sm text">SubItem 1</span></a></li>*@
            </ul>
        </li>
        <li>
            <a class="dropmenu" href="index-2.html#"><i class="icon-table"></i><span class="hidden-sm text">Promociones</span> <span class="chevron closed"></span></a>
            <ul>
                <li><a class="submenu" href="@Url.Action("Edit", "Promocion")"><i class="icon-dashboard"></i><span class="hidden-sm text">Configuración</span></a></li>
                @*<li><a class="submenu" href="#"><i class="icon-file-text-alt"></i><span class="hidden-sm text">SubItem 1</span></a></li>
                <li><a class="submenu" href="#"><i class="icon-tasks"></i><span class="hidden-sm text">SubItem 2</span></a></li>*@
            </ul>
        </li>
        <li>
            <a class="dropmenu" href="index-2.html#"><i class="icon-table"></i><span class="hidden-sm text">Mantenimiento</span> <span class="chevron closed"></span></a>
            <ul>
                <li><a class="submenu" href="@Url.Action("Search", "Cliente")"><i class="icon-dashboard"></i><span class="hidden-sm text">Clientes</span></a></li>
                <li><a class="submenu" href="@Url.Action("Search", "Servicio")"><i class="icon-file-text-alt"></i><span class="hidden-sm text">Servicios</span></a></li>
                <li><a class="submenu" href="@Url.Action("Search", "Promocion")"><i class="icon-tasks"></i><span class="hidden-sm text">Promociones</span></a></li>
            </ul>
        </li>
    </ul>
</div>
<a href="#" id="main-menu-min" class="full visible-md visible-lg"><i class="icon-double-angle-left"></i></a>

@*<script>
    var data = @(Html.Raw(JsonConvert.SerializeObject(user, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore })));

    $(document).ready(function () {
        $(".main-menu").children().remove();
        $(data.Rol.MenuOpcion)
            .filter(function(e,v) { return v.IdMenuOpcionRoot == null } )
            .sort(function(a,b){ return a.MenuOrder>b.MenuOrder })
            .each(function(e,v){
                $(".main-menu").append("<li id='"+v.IdMenuOpcion+"'><a class='dropmenu' href='index-2.html#'><i class='icon-list-alt'></i><span class='hidden-sm text'>"+v.Nombre+"</span> <span class='chevron closed'></span></a></li>");
                if (v.MenuOpcion1.length > 0){
                    $("#"+v.IdMenuOpcion).append("<ul></ul>");
                    $(v.MenuOpcion1)
                    .sort(function(a,b){ return a.MenuOrder>b.MenuOrder })
                    .each(function(e1,v1){
                        $("#"+v.IdMenuOpcion +" ul").append("<li><a class='submenu' href='" + v1.URL + "'><i class='icon-dashboard'></i><span class='hidden-sm text'>"+ v1.Nombre +"</span></a></li>");
                    });
                }
                
                $(".main-menu").append("");                
            });
    });
</script>*@
